﻿<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<base href="<%=basePath%>">

		<title>四川省辽宁商会</title>

		<link rel="shortcut icon" href="image/favicon.ico" type="image/x-icon" />
		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">
		<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
		<meta http-equiv="description" content="This is my page">
		<meta name="viewport" content="width=device-width, initial-scale=1" />
		<link rel="stylesheet" href=" css/index.css">
		<link rel="stylesheet" href=" css/top.css">
		<link rel="stylesheet" href=" css/mjgk.css">
		<link rel="stylesheet"
			href=" framework/bootstrap-3.0.0/css/bootstrap.css">

		<link rel="stylesheet" type="text/css"
			href="common/front/style/style.css" />
		<script src="common/front/js/jquery-1.11.3.min.js"></script>
		<script src="common/front/js/bootstrap.min.js"></script>
		<link rel="stylesheet"
			href=" framework/bootstrap-3.0.0/css/bootstrap.min.css">
		<link rel="stylesheet"
			href="framework/bootstrap-3.0.0/css/bootstrap-theme.css">
		<link href=" framework/bootstrap-3.0.0/css/bootstrap-combined.min.css"
			rel="stylesheet">
		<link
			href="<%=basePath%>common/plugins/datatables/dataTables.bootstrap.css"
			rel="stylesheet" type="text/css" />
		<script src="<%=basePath%>common/plugins/jQuery/jQuery-2.1.3.min.js"></script>
		<script
			src="<%=basePath%>common/plugins/datatables/jquery.dataTables.js"
			type="text/javascript"></script>
		<script
			src="<%=basePath%>common/plugins/datatables/dataTables.bootstrap.js"
			type="text/javascript"></script>
		<script type="text/javascript" src="js/jquery.js"></script>
		<meta http-equiv=“X-UA-Compatible” content=“IE=7″>
		<meta http-equiv=“X-UA-Compatible” content=“IE=8″>
		<!–[if lt IE 7]>
		<script
			src=”http://ie7-js.googlecode.com/svn/version/2.0(beta)/IE7.js”
			type=”text/javascript”></script>
		<![endif]–>

		<!–[if lt IE 8]>
		<script
			src=”http://ie7-js.googlecode.com/svn/version/2.0(beta)/IE8.js”
			type=”text/javascript”></script>
		<![endif]–>

		<!–[if lt IE 9]>
		<script
			src=”http://ie7-js.googlecode.com/svn/version/2.1(beta4)/IE9.js”></script>
		<![endif]–>


		<style type="text/css">
a {
	text-decoration: none;
	color: black !important;
	font-size: 14px;
}

a:hover {
	text-decoration: none;
	color: #008fd7 !important;
}

#page_navigation a {
	padding: 3px;
	margin: 2px;
	color: black;
	text-decoration: none
}

.active_page {
	color: #008fd7 !important;
}

#txt {
	height: 110px;
	overflow: hidden;
}

#news {
	height: 25px;
	overflow: hidden;
	float: left;
}
</style>

		<script type="text/javascript">
	window.onload = function() {

	/*	var text = document.getElementById('txt'), str = text.innerHTML, textLeng = 300;
		if (str.length > textLeng) {
			text.innerHTML = str.substring(0, textLeng) + "......";
		}*/
		
		var obj = document.getElementById('txt');
    	var total_height =  obj.scrollHeight;//文章总高度
    	var show_height = 110;//定义原始显示高度
    	
    	var obj = document.getElementById('news');
    	var total_height =  obj.scrollHeight;//文章总高度
    	var show_height = 25;//定义原始显示高度

	}

	$(document).ready(function(){
			var show_per_page = 8; 
			var number_of_items = $('#content').children().size();
			var number_of_pages = Math.ceil(number_of_items/show_per_page);
			$('#current_page').val(0);
			$('#show_per_page').val(show_per_page);
			var navigation_html = '<center><a class="previous_link" href="javascript:previous();">上一页</a>';
			var current_link = 0;
			while(number_of_pages > current_link){
				navigation_html += '<a class="page_link" href="javascript:go_to_page(' + current_link +')" longdesc="' + current_link +'">'+ (current_link + 1) +'</a>';
				current_link++;
			}
			navigation_html += '<a class="next_link" href="javascript:next();">下一页</a></center>';
			$('#page_navigation').html(navigation_html);
			$('#page_navigation .page_link:first').addClass('active_page');
			$('#content').children().css('display', 'none');
			$('#content').children().slice(0, show_per_page).css('display', 'block');	
		});
		function previous(){
			new_page = parseInt($('#current_page').val()) - 1;
			if($('.active_page').prev('.page_link').length==true){
				go_to_page(new_page);
			}
		}
		function next(){
			new_page = parseInt($('#current_page').val()) + 1;
			//if there is an item after the current active link run the function
			if($('.active_page').next('.page_link').length==true){
				go_to_page(new_page);
			}
		}
		function go_to_page(page_num){
			var show_per_page = parseInt($('#show_per_page').val());
			start_from = page_num * show_per_page;
			end_on = start_from + show_per_page;
			$('#content').children().css('display', 'none').slice(start_from, end_on).css('display', 'block');
			$('.page_link[longdesc=' + page_num +']').addClass('active_page').siblings('.active_page').removeClass('active_page');
			$('#current_page').val(page_num);
		}
</script>
	</head>

	<body
		style="background-color: #eeeeee; font-family: Microsoft YaHei; overflow-y: scroll">
		<div style="top: 0px;"><jsp:include page="top.jsp"></jsp:include></div>
		<div class="show5">
			<div style="margin-left: 1.5%; margin-top: 1.5%;">
				<a href="front/index"> 网站首页</a> >
				<a href="front/xinwen">新闻中心</a>
				<br>
				<br>
			</div>
			<div class="left"
				style="width: 100%; border: 1px solid #eee; height: 1000px;">
				<table width="100%">
					<tr>
						<td style="background-color: #eee;">
							<div class="title">
								新闻中心
							</div>
							
						</td>
					</tr>
				</table>
				<br>
				<input type='hidden' id='current_page' />
				<input type='hidden' id='show_per_page' />

				<div id='content' class="container-fluid" style="padding: 0;">
					<c:forEach items="${baodao}" var="hw">
							<ul style="margin-left: 0 !important;">
								<li style="list-style: none;">
									<div class="row"
										style="border: 1px solid #eee; padding: 1%; margin: 0">
										<div class="col-md-12 col-sm-12 col-xs-12"
											style="padding: 0; margin: 0; padding-right: 1%">
											<div class="tit">
												<img alt="" src="image/dt.gif">
												<a href="front/xwinfo?id=${hw.id }" style="font-size: 16px;font-weight: 600"> ${hw.title }</a>
											</div>
											<div class="time">
												${hw.time }
											</div>
											<br>
											<div id="news">
												${hw.content }
											</div>
											<div class="time" style="color: 008fd7;">
											<a href="front/xwinfo?id=${hw.id }" style="font-size: 14px;font-weight: 600;color: #008fd7 !important;">	查看详情>></a>
											</div>
										</div>
									</div>
								</li>
							</ul>
						
					</c:forEach>
				</div>
				<table id='page_navigation' width="100%"></table>
			</div>

		</div>
		<div class="footer"><jsp:include page="bottom.jsp" flush="true"></jsp:include></div>
	</body>

</html>
